[PATCH] Fix invalid pointer return with QGridLayout::itemAt(-1)
authorZhang Yu <zhangyub@uniontech.com>
Mon, 22 Feb 2021 01:25:01 +0000 (09:25 +0800)
committerDmitry Shachnev <mitya57@debian.org>
Sun, 28 Nov 2021 14:12:50 +0000 (14:12 +0000)
commit5f5e096a0c674a0f66ee628e40cbbf10d9bfff74
treed1b20a2c8cb902d16a1baa8645e715e0f1def0f4
parent9c0dcab049c0704577d2ba57ae573352bc1a93b4
[PATCH] Fix invalid pointer return with QGridLayout::itemAt(-1)

QGridLayout::takeAt() and QLayoutItem *itemAt() only check the upper bound.
If the index < 0, these function will return invalid pointer.

Fixes: QTBUG-91261
Pick-to: 5.15 6.0 6.1
Change-Id: Idfb9fb6228b9707f817353b04974da16205a835c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Gbp-Pq: Name fix-invalid-pointer-return-with-QGridLayout.diff
src/widgets/kernel/qgridlayout.cpp
tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp